<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <title>YUI3 Form</title>
        <link rel="stylesheet" type="text/css" href="assets/skins/sam/yform.css" />
        <link rel="stylesheet" type="text/css" href="../calendar/assets/skins/sam/calendar.css" />
        <style>
        	
        </style>
    </head>
    <body class="yui-skin-sam">
        <div class="testForm"></div>
        <table>
        	<tr><td>field 1: </td><td><input type="text" value="132324234"/></td><td>abcde</td></tr>
        	<tr>
        		<td>field 2: </td>
        		<td>
        			<div class="x-form-field-wrap x-form-field-trigger-wrap">
	        			<input class="x-form-text x-form-field" type="text" value="3445454656"/>
	        			<img class="x-form-trigger x-form-date-trigger" src="../assets/s.gif"/>
        			</div>
        		</td>
        		<td>abcde</td>
        	</tr>
        </table>
        <div id="date1"></div>
    </body>
    <script type="text/javascript" src="http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js"></script>
    <script type="text/javascript" src="date-field.js"></script>
    <script type="text/javascript" src="../../common/yui-ext.js"></script>
    <script type="text/javascript" src="../calendar/calendar.js"></script>
    <script type="text/javascript">
    YUI({
        modules: {
            'gallery-form': {
                fullpath: 'http://yui.yahooapis.com/gallery-2009.11.09-19/build/gallery-form/gallery-form-min.js',
                requires: ['node','attribute','widget','io-form','substitute'],
                optional: [],
                supersedes: []
          }
     
        }
    }).use("gallery-form", "date-field", "t-calendar", function (Y) {
        // Create a Field Object manually
        var myField = new Y.CheckboxField({
            name : "myCheckbox",
            value : "check",
            label : "Test Checkbox"
        });
     
        var f = new Y.Form({
            contentBox: '#testForm',
            action : 'test.php',
            method : 'post',
            fields : [
                myField,
                {name : 'testText', required : true, label : 'Test Label'},
                {name : 'testHiddenField', type : 'hidden'},
                {name : 'testSelectField', type : 'select', choices : [{label : 'Foo', value : 'foo'}, {label : 'Bar', value : 'bar'}], label : 'testSelect'},
                {name : 'submit', type : 'submit', label : 'Submit'},
                {name : 'reset', type : 'reset', label : 'Reset'}
            ]
        });
     
        f.subscribe('success', function (args) {
            alert ('Form submission successful');
        });
        f.subscribe('failure', function (args) {
            alert('Form submission failed');
        });
     
        f.render();

        //
        var date1 = new Y.DateField({contentBox: '#date1'});
        date1.render();

        var c = new T.tbwidget.calendar(Y.Node.get('#date1'),function(d){
	   		 Y.log(Y.dump(d));
	   		 //Y.Node.get('#c').set('value',Y.dump(d));
	   		 date1.set('value', d);
	   		 c.render({selectedate:d});
	   	 },{
	   		date:'2009/11/02' 
	   	 });
    });
    </script>
 </html>